﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public sealed partial class NetworkManager : NetworkProcessMain
{
	/// <summary>
	/// 메세지함 리스팅
	/// </summary>
	/// <param name="t"></param>
	/// <param name="Callback"></param>
	public void C2S_MSG_LIST<T>(int t, System.Action<ResponseModel<T>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<T>);
		
		PT_C2S_MSG_LIST dataPush = new PT_C2S_MSG_LIST();
		dataPush.Reset();
		dataPush.t = t;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}


	/// <summary>
	/// 쪽지 보내기
	/// </summary>
	/// <typeparam name="T"></typeparam>
	/// <param name="id"></param>
	/// <param name="callback"></param>
	public void C2S_MSG_SMAIL(long id, string body, System.Action<ResponseModel<MailMessage>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<MailMessage>);

		PT_C2S_MSG_SMAIL dataPush = new PT_C2S_MSG_SMAIL();
		dataPush.Reset();
		dataPush.id = id;
		dataPush.body = body;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_MSG_SMAIL_BY_NAME(string name, string body, System.Action<ResponseModel<MailMessage>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<MailMessage>);
		
		PT_C2S_MSG_SMAIL_BY_NAME dataPush = new PT_C2S_MSG_SMAIL_BY_NAME();
		dataPush.Reset();
		dataPush.name = name;
		dataPush.body = body;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
	
	/// <summary>
	/// 보상 받기
	/// </summary>
	/// <typeparam name="T"></typeparam>
	/// <param name="id"></param>
	/// <param name="callback"></param>
	public void C2S_MSG_GET_REWARD(long msgid, System.Action<ResponseModel<UserModel>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);
		
		PT_C2S_MSG_GET_REWARD dataPush = new PT_C2S_MSG_GET_REWARD();
		dataPush.Reset();
		dataPush.msgid = msgid;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
	
	
	/// <summary>
	/// 전체 보상 받기
	/// </summary>
	/// <typeparam name="T"></typeparam>
	/// <param name="id"></param>
	/// <param name="callback"></param>
	public void C2S_MSG_GET_ALL_REWARD(System.Action<ResponseModel<UserModel>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);
		
		PT_C2S_MSG_GET_ALL_REWARD dataPush = new PT_C2S_MSG_GET_ALL_REWARD();
		dataPush.Reset();
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
	
	/// <summary>
	/// 아이템 받기
	/// </summary>
	/// <typeparam name="T"></typeparam>
	/// <param name="ids"></param>
	/// <param name="callback"></param>
	public void C2S_MSG_GET(long[] ids, System.Action<ResponseModel<UserModel>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<UserModel>);
		
		PT_C2S_MSG_GET dataPush = new PT_C2S_MSG_GET();
		dataPush.Reset();
		dataPush.ids = ids;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	/// <summary>
	/// 메세지 삭제
	/// </summary>
	public void C2S_MSG_REMOVE(long msgid, int msgtype, System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<object>);
		
		PT_C2S_MSG_REMOVE dataPush = new PT_C2S_MSG_REMOVE();
		dataPush.Reset();
		dataPush.msgid = msgid;
		dataPush.msgtype = msgtype;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}

	/// <summary>
	/// 메세지 전부 삭제
	/// </summary>
	public void C2S_MSG_ALLREMOVE(int msgtype, System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.CallbackErr = Callback;
		msg.Type = typeof(ResponseModel<object>);
		
		PT_C2S_MSG_ALLREMOVE dataPush = new PT_C2S_MSG_ALLREMOVE();
		dataPush.Reset();
		dataPush.msgtype = msgtype;
		
		dataPush.PushData(ref msg);
		PushPacketToTrasmitQue(msg);
	}
}